#ifndef _PAGE_H_
#define _PAGE_H_

#include "access/BufferManager.h"

#include <pthread.h>

class Page
{
public:
	Page(BufferManager* manager, Page* orgPage=NULL);
	virtual ~Page();

    Page(const Page &p);
    
	int GetID(){return nodeID;};

	bool LoadFromFile();

	bool SaveToFile();

    pthread_mutex_t* LockPage();
 
private:
    pthread_mutex_t page_mutex;

protected:
	int pageSize;
	int nodeID;
	
	char* buffer;
	BufferManager* bm;

};

#endif

